package edu.sctu.practice.class02.Wangpeng.Assign03.Assign303;

/**
 * Created by wp on 2015/11/17.
 */
public class Cilent {
    public static void main(String[] args) {
        CloneableCircle c1=new CloneableCircle(3);
        CloneableCircle c2=(CloneableCircle)c1.clone();
        System.out.println("After copying c1 to circl2");

        if(c1==c2)
            System.out.println("c1 and c2 reference to the same object");
        else System.out.println("c1 and c2 dont point to the same object");
        if(c1.equals(c2)) System.out.println("c1 and c2 have the same contents");
        else System.out.println("c1 and c2 dont have the same contents");

        c1.setRadius(8);
        System.out.println("\nAfter modifying c1");
        System.out.println("c1 " + c1);
        System.out.println("c2 " + c2);
        System.out.println();
        if (c1 instanceof Cloneable) {
            System.out.println("A CloneableCircle objec is cloneable");
        } else {
            System.out.println("A CloneableCircle objec is not cloneable");
        }
        Circle c = new Circle();
        if (c instanceof Cloneable) {
            System.out.println("A Circle object is cloneable");
        } else {
            System.out.println("A Circle object is not cloneable");
        }
    }
}



